<!-- 
    Copyright (C)  2011  chen wei hua.
    Permission is granted to copy, distribute and/or modify this document
    under the terms of the GNU Free Documentation License, Version 2.0
    or any later version published by the Free Software Foundation;
    with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
    A copy of the license is included in the section entitled "GNU Free Documentation License".
 -->
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>常用数据管理</title>
<%@ include file="config.jsp"%>
<script type="text/javascript">
function deleteItem(id){
	if (window.confirm('确定要删除这个常用数据吗?')==true) {
		window.location.href = 'deleteBaseCode.action?baseCodeId=' + id;
	}
}
function submit() {
	alert("submit");
	$("#baseCodeList").submit();
    return false;
}
</script>
</head>
<body>
    <div class="subnav" align="left">
           <table width="100%" border="0" cellspacing="0" cellpadding="0">
		  <tr>
			<td width="100%" align="left" height="31">&nbsp;<img src="common/images/title-pk.gif" border="0"  align="absmiddle"/>&nbsp;<span class="subnavtxt1">基础数据管理</span>
			&nbsp;<img src="common/images/leftico2.gif" border="0"  align="absmiddle"/>&nbsp;<span class="subnavtxt2">常用数据管理</span></td>
		  </tr>
		</table>
      </div>
<s:actionerror cssStyle="color:red"/>
<div class="main_1">
<s:form action="baseCodeList">
<table width="99%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="80%">
    	<strong>常用数据分类:</strong>&nbsp;&nbsp;
      	<s:select name="codeCategory"
      		list="codeCategoryList"
      		listKey="id"
      		listValue="value"
      		headerKey="-1"
      		headerValue="-请选择-"
      		onchange="submit()"/>
    </td>
    <td width="20%" align="right">
      <s:if test="codeCategory!=-1">
    	<input type="button" value="添加新数据" onclick=javascript:window.location.href='addBaseCode.action?codeCategory=<s:property value="codeCategory" />'  class="inputlong" />
      </s:if>
    </td>
  </tr>
</table>
</s:form>
<div class="ksglxx2">
  <table width="100%" cellpadding="0" cellspacing="1" border="0" class="ksglxx2a">
        <tr class="ksglxx2bg">
           <th width="35%" align="left">数据名称</th>
           <th width="35%" align="left">数据描述</th>
           <th align="left"></th>
        </tr>
        <s:iterator value="baseCodeList" id="code" status="st">
          <s:if test="#st.Odd">
            <tr class="odd">
              <td><s:property value="#code.name" /></td>
              <td><s:property value="#code.descript" /></td>
              <td align="center">
                <a class="b" href='editBaseCode.action?baseCodeId=<s:property value="#code.id" />'>
                  <img src="common/images/Edit.gif" alt="Edit" border="0" align="absmiddle" /></a>&nbsp;&nbsp;
                <a class="b" href='javascript:deleteItem(<s:property value="#code.id" />)'>
                  <img src="common/images/Delete.gif" alt="Delete" border="0" align="absmiddle" /></a>
         	  </td>
            </tr>
          </s:if>
          <s:else>
            <tr class="even">
              <td><s:property value="#code.name" /></td>
              <td><s:property value="#code.descript" /></td>
              <td align="center">
                <a class="b" href='editBaseCode.action?baseCodeId=<s:property value="#code.id" />'>
                  <img src="common/images/Edit.gif" alt="Edit" border="0" align="absmiddle" /></a>&nbsp;&nbsp;
                <a class="b" href='javascript:deleteItem(<s:property value="#code.id" />)'>
                  <img src="common/images/Delete.gif" alt="Delete" border="0" align="absmiddle" />
                </a>
         	  </td>
            </tr>
           </s:else>
         </s:iterator> 
  </table>
</div>
</body>
</html>
